{include file="public/layout"/}
<body data-type="generalComponents">
    <div class="tpl-content-wrapper">
        <ol class="am-breadcrumb">
            <li><a href="javascript:void(0)" onclick="javascript:parent.openItem('welcome|Index');" class="am-icon-home">首页</a></li>
            <li class="am-active">权限</li>
            <li><a href="{:url('admin/index')}">管理员列表</a></li>
            <li class="am-active">管理员-编辑管理员</li>
        </ol>
        <div class="tpl-portlet-components">
            <div class="tpl-block ">
                <div class="am-g tpl-amazeui-form">
                    <div class="am-u-sm-12 am-u-md-9">
                        <form class="am-form am-form-horizontal js-ajax-form" action="{:url('admin/adminHandle')}" method="post">
                            <input type="hidden" name="act" value="{$act}">
                            <input type="hidden" name="admin_id" value="{$info.admin_id ?? ''}">
                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">用户名</label>
                                <div class="am-u-sm-9">
                                    <input type="text" name="user_name" value="{$info.user_name ?? ''}" id="user-name" placeholder="登录名" class="required">
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-email" class="am-u-sm-3 am-form-label">Email地址</label>
                                <div class="am-u-sm-9">
                                    <input type="email" name="email" value="{$info.email ?? ''}" id="user-email" placeholder="输入你的电子邮件 / Email">
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-phone" class="am-u-sm-3 am-form-label">登录密码</label>
                                <div class="am-u-sm-9">
                                    <input type="text" name="password" value="{$info.password ?? ''}" id="user-phone" placeholder="输入登录密码" {if condition="$act == 'add'"}class="required"{/if}>
                                </div>
                            </div>
                            {if condition=" ($act eq 'add') OR ($info['admin_id'] gt 1)"}
                            <div class="am-form-group">
                                <label for="role_id" class="am-u-sm-3 am-form-label">所属角色</label>
                                <div class="am-u-sm-9">
                                    <select name="role_id" id="role_id">
                                        {volist name="role" id="v"}
                                            <option value="{$v.role_id}" {if condition="isset($info['role_id']) && $v['role_id'] eq $v['role_id']"} selected="selected"{/if}>{$v.role_name}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            {/if}
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3">
                                    <button type="submit" class="am-btn am-btn-primary js-ajax-submit">提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="__ADMIN__/js/admin.js"></script>
</body>
</html>